La libreria di riferimento di Python by Guido van Rossum Fred L. Drake Jr. editor
Author:Guido van Rossum, Fred L. Drake, Jr., editor
Language: eng
Format: epub
Apre un flusso non compresso in scrittura.
’w|gz’
Apre un flusso compresso gzip in scrittura.
’w|bz2’
Apre un flusso compresso bzip2 in scrittura.
class TarFile
Classe per leggere e scrivere archivi tar. Non usare questa classe direttamente, meglio invece usare open().
Leggere “Oggetti TarFile” (sezione 7.19.1).
is_tarfile( name)
Restituisce True se name è un file archivio tar, del tipo che può essere letto dal modulo tarfile.
class TarFileCompat( filename[ , mode[ , compression ] ])
Classe per l’accesso limitato agli archivi tar con interfaccia simile a zipfile.
Consultare la
documentazione di zipfile per ulteriori dettagli. compression deve essere una delle seguenti costanti:
TAR_PLAIN
Costante per un archivio tar non compresso.
TAR_GZIPPED
Costante per un archivio tar compresso con gzip.
exception TarError
Classe base per tutte le eccezioni di tarfile.
exception ReadError
Viene sollevata quando un archivio tar viene aperto, ma non può essere gestito dal modulo tarfile o per
qualche ragione non è valido.
exception CompressionError
Viene sollevata quando un metodo di compressione non è supportato o quando i dati non possono essere
decodificati in modo appropriato.
exception StreamError
Viene sollevata dalle limitazioni tipiche per gli oggetti TarFile simil-flusso.
exception ExtractError
Viene
sollevata
per
errori
non
fatali
durante
l’utilizzo
di
extract(),
ma
solo
se
TarFile.errorlevel == 2.
7.19. tarfile — Leggere e scrivere file di archivio tar
389
Vedete anche:
Modulo zipfile (sezione 7.18):
Documentazione del modulo standard zipfile.
Manuale tar della GNU, Standard Section
(http://www.gnu.org/manual/tar/html_chapter/tar_8.html#SEC118)
Documentazione per i file di archivio tar, incluse le estensioni tar della GNU.
7.19.1
Oggetti TarFile
L’oggetto TarFile fornisce un’interfaccia ad un archivio tar. Un archivio tar è una sequenza di blocchi. Un
membro d’archivio (un file immagazzinato) è composto da un blocco d’intestazione seguito dai blocchi dei dati.
È possibile immagazzinare un file in un archivio tar più volte. Ogni membro dell’archivio viene rappresentato da
un oggetto TarInfo, leggere Oggetti TarInfo (sezione 7.19.2) per dettagli.
class TarFile([ name [ , mode[ , fileobj ] ] ])
Apre un archivio tar (non compresso) di nome name. mode è ’r’ per leggere da un archivio esistente, ’a’
per aggiungere dati ad un file esistente o ’w’ per crearne uno nuovo sovrascrivendone uno esistente. mode
come valore predefinito ha ’r’.
Se fileobj viene passato, viene usato per leggere o scrivere dati. Se può essere determinato, mode viene
sovrascritto dal modo di fileobj.
Note: fileobj non viene chiuso quando viene chiuso TarFile.
open( ... )
Costruttore alternativo. La funzione open() a livello modulo è in realtà una scorciatoia per questo metodo
di classe. Vedere la sezione 7.19 per dettagli.
getmember( name)
Restituisce un oggetto TarInfo per il membro name. Se name non può essere trovato nell’archivio, viene
sollevata un’eccezione KeyError.
Note: Se un membro appare più volte in un archivio, la sua ultima occorrenza viene considerata come la
versione più aggiornata.
getmembers()
Restituisce i membri dell’archivio come una lista di oggetti TarInfo. La lista ha lo stesso ordine dei
membri nell’archivio.
getnames()
Restituisce i membri come lista dei loro nomi. Ha lo stesso ordine della lista restituita da getmembers().
list( verbose=True)
Stampa un indice verso sys.stdout. Se verbose è False, vengono stampati solo i nomi dei membri.
Se è True, viene prodotto un output simile a quello di ls -l.
next()
Restituisce il prossimo membro dell’archivio come oggetto TarInfo, quando TarFile viene aperto in
lettura. Restituisce None se non ce ne sono altri disponibili.
extract( member[ , path ])
Estrae un membro dall’archivio nella directory corrente, usando il suo nome completo. Le sue informazioni
di file vengono estratte nel modo più accurato possibile.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Personalized inhaled bacteriophage therapy for treatment of multidrug-resistant Pseudomonas aeruginosa in cystic fibrosis by unknow(172808)
CONSORT 2025 statement: updated guideline for reporting randomized trials by unknow(81266)
Critical evaluation of the ProfiLER-02 study design and outcomes by Vivek Subbiah & Razelle Kurzrock(80860)
Cardiac gene therapy makes a comeback by Oliver J. Müller & Susanne Hille & Anca Kliesow Remes(80612)
Whisky: Malt Whiskies of Scotland (Collins Little Books) by dominic roskrow(74428)
Unveiling the design rules for tunable emission in graphene quantum dots: A high-throughput TDDFT and machine learning perspective by Şener Özönder & Mustafa Coşkun Özdemir & Caner Ünlü(50884)
A yeast-based oral therapeutic delivers immune checkpoint inhibitors to reduce intestinal tumor burden by unknow(40256)
Covalent hitchhikers guide proteins to the nucleus by Alexander F. Russell & Madeline F. Currie & Champak Chatterjee(40214)
Meet the Authors: Christopher R. Mansfield and Emily R. Derbyshire by Christopher R. Mansfield & Emily R. Derbyshire(40091)
Alkaline-earth metals promote propane dehydrogenation with carbon dioxide through geometric effects: Altering the reaction pathway by unknow(32728)
Induced iron vacancies boosting FeOOH loaded on sustainable Fenton-like collagen fiber membrane for efficient removal of emerging contaminants by unknow(32503)
Efficient electric-field-assisted photochemical conversion of methane to n-propanol exclusively over penetrated TiO2Ti hollow fibers by Guanghui Feng(32451)
Bi2SiO5 nanosheets as piezo-photocatalyst for efficient degradation of 2,4-Dichlorophenol by Hangyu Shi & Yifu Li & Lishan Zhang & Guoguan Liu & Qian Zhang & Xuan Ru & Shan Zhong(32382)
A novel NDIPTA organic heterojunction photocatalyst with built-in electric field for efficient hydrogen production by Jiahui Yang & Baojun Ma & Yongfa Zhu(32358)
Enhanced conversion of methane to liquid-phase oxygenates via hollow ferrite nanotube@horseradish peroxidase based photoenzymatic catalysis by Jun Duan & Shiying Fan & Xinyong Li & Shaomin Liu(32330)
Ordered macroporous superstructure of defective carbon adorned with tiny cobalt sulfide for selective electrocatalytic hydrogenation of cinnamaldehyde by Xiao-Shi Yuan & Sheng-Hua Zhou & San-Mei Wang & Wenbo Wei & Xiaofang Li & Xin-Tao Wu & Qi-Long Zhu(32256)
What's Done in Darkness by Kayla Perrin(27139)
Topological analysis of non-conjugated ethylene oxide cored dendrimers decorated with tetraphenylethylene: Insights from degree-based descriptors using the polynomial approach by A Theertha Nair & D Antony Xavier & Annmaria Baby & S Akhila(26517)
Investigation of mechanical and self-healing properties of hydroxyl-terminated polybutadiene functionalized with 2-ureido-4-pyrimidinone by Mohsen Kazazi & Mehran Hayaty & Ali Mousaviazar(26453)